package com.shensi.api.admin.client.station;

import com.shensi.api.admin.client.fallback.monitor.SysLogininforClientFallBack;
import com.shensi.api.admin.domian.market.dto.OilDto;
import com.shensi.api.admin.domian.station.dto.OilEngine;
import com.shensi.api.admin.domian.station.dto.OilEngineDto;
import com.shensi.api.admin.domian.station.dto.OilEngineSumDto;
import com.shensi.common.core.constant.CloudConstant;
import com.shensi.common.core.domain.AjaxResult;
import com.shensi.common.core.page.TableDataInfo;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;


/**
 * @author mao
 */
@FeignClient(
        value = CloudConstant.ADMIN_SERVER,
        fallbackFactory = SysLogininforClientFallBack.class)
@Component
public interface OilEngineClient {

    // 分页查询 油机数据列表  订单号不能超过11位
    @PostMapping("/engine/list")
    public TableDataInfo getOilEngineList(@RequestBody(required = false) OilEngineDto oilEngineDto);

    // 合计统计
    @PostMapping("/engine/oilEngineSum")
    public AjaxResult getOilEngineSum(@RequestBody(required = false) OilEngineDto oilEngineDto);


    /**油机订单数据下所有油品*/
    @GetMapping("/engine/oilName")
    public AjaxResult getOilName(@RequestParam(value = "enterpriseId",required = false) Long enterpriseId);

    /**油机订单数据下所有油枪*/
    @GetMapping("/engine/oilGun")
    public AjaxResult getOilGun(@RequestParam(value = "enterpriseId",required = false) Long enterpriseId);

    /**
     * 查询油机数据录入信息
     * 根据油枪和订单创建时间查询10分钟的订单
     * */
    @PostMapping("/engine/listByGun")
    public AjaxResult listByGun(@RequestBody(required = false) OilEngine oilEngine);

    /**
     * 公众号支付油机订单后，修改订单状态和记录支付时间
     * */
    @PostMapping("/engine/payment")
    public AjaxResult paymentOilOrder(@RequestBody OilEngineDto oilEngineDto);

}
